<template>
  <div class="headBox">
    <p @click="handleBack">
      <img v-if="!isForward" src="@/assets/images/back.png" alt="" class="back_img" />
      <img v-else src="@/assets/images/back.png" alt="" class="back_img" />
    </p>
    <p>{{ title }}</p>
    <img src="@/assets/images/more.png" class="back_img" />
  </div>
</template>

<script setup>
import { useRouter } from 'vue-router';
const router = useRouter();
const props = defineProps({
  title: {
    type: String,
    default: '管理系统',
  },
  isForward: Boolean,
  img: String,
});

function handleBack() {
  console.log('handleBack');
  router.back();
}
</script>

<style scoped lang="scss">
.headBox {
  padding: 32px 12px 0 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  p {
    height: 24px;
    font-family: PingFang SC, PingFang SC;
    font-weight: 600;
    font-size: 15px;
    color: #333333;
    line-height: 24px;
    text-align: center;
  }
  .back_img {
    width: 18px;
    height: 18px;
  }
}
</style>
